/*
 *
 * Date: 2017年11月15日
 * Time: 下午2:15:55
 *
 */

package com.lmx.repoDomain.tmodel;

import io.katharsis.resource.annotations.JsonApiIncludeByDefault;
import io.katharsis.resource.annotations.JsonApiResource;
import io.katharsis.resource.annotations.JsonApiToOne;

import javax.persistence.*;

import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;

/**
 * 本地摄像头
 * 
 * @author 梁慕学
 * @version 1.00
 */

@JsonApiResource(type = "camera")
@Table(name = "tnb_camera")
@Entity
public class Camera extends BaseEntity{
	private String code;// 序列号
	private String accessName; //接入用户名
	private String accessPass; //接入密码
	private String ip;// ip地址
	private Integer port;// 端口号
	private Integer createTime;// 创建时间
	private Integer updateTime;// 更新时间
	private Integer status;// 连接状态 1.已连接 0.未连接   
	private Integer liveStatus;//拉流状态 1.远程拉流已开启 0未开启
	private String remark;// 备注
	private String uri;
	
	private String operateTarget;

	private String operateFlag;// 解绑 绑定操作
	
	private Dicttype bindStatus;// 已绑定，空闲
	
	private Integer audienceNum;
	
	@Transient
	public Integer getAudienceNum() {
		return audienceNum;
	}

	public void setAudienceNum(Integer audienceNum) {
		this.audienceNum = audienceNum;
	}

	@JsonApiToOne
	@JsonApiIncludeByDefault
	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
	@Fetch(FetchMode.JOIN)
	@JoinColumn(name = "bind_status_id", foreignKey = @ForeignKey(name = "null"))
	public Dicttype getBindStatus() {
		return bindStatus;
	}

	public void setBindStatus(Dicttype bindStatus) {
		this.bindStatus = bindStatus;
	}
	
	@Transient
	public String getOperateTarget() {
		return operateTarget;
	}

	public void setOperateTarget(String operateTarget) {
		this.operateTarget = operateTarget;
	}

	@Transient
	public String getOperateFlag() {
		return operateFlag;
	}

	public void setOperateFlag(String operateFlag) {
		this.operateFlag = operateFlag;
	}
	
	@Column(name = "uri")
	public String getUri() {
		return uri;
	}

	public void setUri(String uri) {
		this.uri = uri;
	}
	
	@Column(name = "code")
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}
	   
	@Column(name = "access_name")
	public String getAccessName() {
        return accessName;
    }

    public void setAccessName(String accessName) {
        this.accessName = accessName;
    }
    
    @Column(name = "access_pass")
    public String getAccessPass() {
        return accessPass;
    }

    public void setAccessPass(String accessPass) {
        this.accessPass = accessPass;
    }

    @Column(name = "ip")
	public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }
    @Column(name = "port")
    public Integer getPort() {
        return port;
    }

    public void setPort(Integer port) {
        this.port = port;
    }
    @Column(name = "status")
    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }
    @Column(name = "live_status")
    public Integer getLiveStatus() {
        return liveStatus;
    }

    public void setLiveStatus(Integer liveStatus) {
        this.liveStatus = liveStatus;
    }

    @Column(name = "create_time")
	public Integer getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Integer createTime) {
		this.createTime = createTime;
	}

	@Column(name = "update_time")
	public Integer getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Integer updateTime) {
		this.updateTime = updateTime;
	}

	@Column(name = "remark")
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

}
